Ext.onReady(function(){
// Panel for the west

        var nav = new Ext.Panel({
            title: '功能菜单',
            region: 'west',
            split: true,
            width: 200,
            collapsible: true,
            margins:'3 0 3 3',
            cmargins:'3 3 3 3',
            frame:true,
            items:[new Ext.Button({
		        text: 'Add Tab',
		        handler: addTab,
		        iconCls:'new-tab'
		    }),{
                 html: ''
            }]
        });
        
        var nor = new Ext.Panel({
            region: 'north',
            height: 60,
            collapsible: true,
            frame:true,
            margins:'3 0 3 3',
            cmargins:'3 3 3 3',
            items:[{
                 html: ''
            }]
        });

	var tabs = new Ext.TabPanel({
	            region: 'center',
	            margins:'3 3 3 0', 
	            activeTab: 0,
	            enableTabScroll:true,
	            defaults:{autoScroll:true},
        		//plugins: new Ext.ux.TabCloseMenu(),
	            items:[{
	                title: '分类管理',
	                html: '<iframe id=cat src="../catalog/catalog.jsp" height=100% width=100% frameborder=0 scrolling=auto></iframe>',
	                closable:true
	            },{
	                title: '维度管理',
	                html: '<iframe id=demension src="../demension/weidu_manage.jsp" height=100% width=100% frameborder=0 scrolling=auto></iframe>',
	                closable:true
	                
	            },{
	                title: '指标管理',
	                html: '<iframe id=report src="../report/zhibiao_manage.jsp" height=100% width=100% frameborder=0 scrolling=auto></iframe>',
	                closable:true
	            },{
	                title: '角色指标',
	                html: '<iframe id=reprole src="../purview/localpurview.jsp" height=100% width=100% frameborder=0 scrolling=auto></iframe>',
	                closable:true
	            },{
	                title: '数据填报',
	                html: '<iframe id=repdata src="../shuju_tianbao/Data_Tianbao.jsp" height=100% width=100% frameborder=0 scrolling=auto></iframe>',
	                closable:true
	            },{
	                title: '数据查询',
	                html: '<iframe id=repquery src="../shuju_chaxun/Data_chaxun.jsp" height=100% width=100% frameborder=0 scrolling=auto></iframe>',
	                closable:true
	            },{
	                title: '主题池管理',
	                html: '<iframe id=subject src="../subject/subject_pool.jsp" height=100% width=100% frameborder=0 scrolling=auto></iframe>',
	                closable:true
	            }
	           /* ,{
	                title: '主题池指标管理',
	                html: '<iframe id=subjrep src="../subject_rep/subject_rep.jsp" height=100% width=100% frameborder=0 scrolling=auto></iframe>',
	                closable:true
	            }*/
	            ,{
	                title: '流程管理',
	                html: '<iframe id=process src="../process/process_manage.jsp" height=100% width=100% frameborder=0 scrolling=auto></iframe>',
	                closable:true
	            },{
	                title: '流程指标管理',
	                html: '<iframe id=procrep src="../process_rep_relate/process_rep_relate.jsp" height=100% width=100% frameborder=0 scrolling=auto></iframe>',
	                closable:true
	            },{
	                title: '事实表',
	                html: '<iframe id=reffact src="../reffact/reffact.jsp" height=100% width=100% frameborder=0 scrolling=auto></iframe>',
	                closable:true
	            },{
	                title: '指标录入统计',
	                html: '<iframe id=repsta src="../report_statistics/report_statistics.jsp" height=100% width=100% frameborder=0 scrolling=auto></iframe>',
	                closable:true
	            },{
	                title: '历史数据补录',
	                html: '<iframe id=repquery src="../history_data/Data_Tianbao.jsp" height=100% width=100% frameborder=0 scrolling=auto></iframe>',
	                closable:true
	            },{
	                title: '日志查询',
	                html: '<iframe id=repquery src="../logsinfo/logsinfo.jsp" height=100% width=100% frameborder=0 scrolling=auto></iframe>',
	                closable:true
	            }
	            ]
	        });
	
	var index = 0;       
	function addTab(){
        tabs.add({
            title: 'New Tab ' + (++index),
            iconCls: 'tabs',
            html: 'Tab Body ' + (index) + '<br/><br/>',                   
            closable:true
        }).show();
    }
            
		var viewport = new Ext.Viewport({
        layout:'border',
        items:[
            tabs
         ]
    });
});